<template>
  <div class="container">
    <picture-text :newstype="trainNew"></picture-text>
    <!-- 链接直达 -->
    <function-link class="shotbox"></function-link>
    <div class="news-box longbox">
      <div class="title2">
        操舞新闻
      </div>
      <div class="shotbox">
        <el-card class="new-list" v-for="(item,index) in newList" :key="index" shadow="hover">
          <!-- <div class="box">
            <div class="left">
              <img style="width: 100%;height: 100%;" :src="url + item.filePath" />
            </div>
            <div class="content right">{{ item.discription }}</div>
          </div> -->
          <div class="new-box" @click="gotoNew(item)">
            <div class="new-left">
              <img style="width: 100%;height: 170px;" :src="url + item.filePath" />
            </div>
            <div class="new-right">
              <p><span style="font-size: 20px;font-weight:bold">{{ item.title }}</span><br/>{{ item.discription }}</p>
            </div>
          </div>
        </el-card>
        <div class="more" style="text-align: center;">
          <el-button type="primary" @click="toNEwList">查看更多</el-button>
        </div>
      </div>
    </div>
    <div class="photo-box">
      <image-list :title="imageListTitle"></image-list>
    </div>
  </div>
</template>
<script>
import {getFivetNew} from '@/api/official'
import http from '@/utils/baseUrl'
import PictureText from '@/components/PictureText/index.vue'
import FunctionLink from '@/components/FunctionLink/index.vue'
import ImageList from '@/components/ImageList/index.vue'
export default {
  components:{
    PictureText,
    FunctionLink,
    ImageList
  },
  mounted() {
    this.getFiveNews()
  },
  data () {
    return {
      trainNew:{
        title:'新闻通知',
        type:'',
        label:'最新动态'
      },
      url: http,
      newList:[],
      imageListTitle:'操舞精彩照片',
    }
  },
  methods:{
    getFiveNews() {
      getFivetNew().then(res => {
        this.newList = res.data.list
      })
    },
    toNEwList() {
      this.$router.push('/new-list')
    },
    gotoNew(item) {
      this.$router.push({path:`/new-detail/${item.id}`})
    }
  }
}
</script>
<style scoped>
.new-list {
  margin-bottom: 15px;
}
.new-box {
  clear: both;
  height: 200px;
}
.new-left {
  float: left;
  width: 20%;
  padding: 15px;
}
.new-right {
  float: right;
  width: 74%;
  padding: 15px;
}
.new-right p {
  padding-left: 2em;
  text-indent: 2em;
  font-size: 16px;
  text-align: justify;
  line-height: 26px;
  overflow: hidden;
  height: 160px;
}
.el-card__body, .el-main {
    padding: 0px;
}
/* .new-list {
  margin-bottom: 10px;
  display: flex;
  flex-direction: row;
  display: inline-block;
}
.new-list .box {
  width: 100%;
  height: 165px;
  clear: both;
}
.left {
  float: left;
  width: 20%;
  height: 160px;
}
.right {
  float: right;
  width: 75%;
}
.new-list .box .content {
  padding-left: 2em;
  text-indent: 2em;
  font-size: 16px;
  text-align: justify;
  line-height: 26px;
  overflow: hidden;
  height: 160px;
} */
</style>
